﻿@model IEnumerable<TruckingApplication.Dal.EntityModels.RESOURCE_COMPANY>

@{
    ViewBag.Title = "OurResources";
}

<h2>OurResources</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            Type
        </th>
        <th>
            Name
        </th>
        <th>
            Phone
        </th>
        <th>
            Email
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.RESOURCE.RESOURCE_TYPE.resourceType)
        </td>
        <td>
            @{ var name = string.Format("{0} {1}", item.RESOURCE.firstName, item.RESOURCE.lastName);}
            @Html.ActionLink(name, "Details", new { /* id=item.PrimaryKey */ })
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.RESOURCE.phone)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.RESOURCE.email)
        </td>
    </tr>
}

</table>
